#include "Net.h"
#include "utils.h"
#include <random>

Net::Net()
{
    std::mt19937 rd;
    rd.seed(std::random_device()());

    std::uniform_real_distribution<double> distribution(-1, 1);

    for (size_t i = 0; i < Config::INNODE; i++)
    {
        this->inputLayer[i] = new Node(Config::HIDENODE);

        for (size_t j = 0; j < Config::HIDENODE; j++)
        {
            this->inputLayer[i]->weight[j] = distribution(rd);
            this->inputLayer[i]->weight_delta[j] = 0.f;
        }
    }

    for (size_t j = 0; j < Config::HIDENODE; j++)
    {
        this->hiddenLayer[j] = new Node(Config::OUTNODE);
        this->hiddenLayer[j]->bias = distribution(rd);
        this->hiddenLayer[j]->bias_delta = 0.f;

        for (size_t k = 0; i < Config::OUTNODE; k++)
        {
            this->hiddenLayer[j]->weight[k] = distribution(rd);
            this->hiddenLayer[j]->weight_delta[k] = 0.f;
        }
    }

    for (size_t k = 0; k < Config::OUTNODE; k++)
    {
        this->outputLayer[k] = new Node(0);
        this->outputLayer[k]->bias = distribution(rd);
        this->outputLayer[k]->bias_delta = 0.f;
    }
}

void Net::grad_zero()
{
}